/**
 * @file MCU_CRC.c
 * @brief
 * @author F00
 * @date 2025-05-22
 */

#include "Common.h"
#include "stm32h7xx_hal.h"

CRC_HandleTypeDef hcrc;

/**
 * @brief CRC Initialization Function
 * @param None
 * @retval None
 */
void MX_CRC_Init(void)
{
    hcrc.Instance = CRC;
    hcrc.Init.DefaultPolynomialUse = DEFAULT_POLYNOMIAL_ENABLE;
    hcrc.Init.DefaultInitValueUse = DEFAULT_INIT_VALUE_ENABLE;
    hcrc.Init.InputDataInversionMode = CRC_INPUTDATA_INVERSION_NONE;
    hcrc.Init.OutputDataInversionMode = CRC_OUTPUTDATA_INVERSION_DISABLE;
    hcrc.InputDataFormat = CRC_INPUTDATA_FORMAT_WORDS;
    if (HAL_CRC_Init(&hcrc) != HAL_OK)
    {
        Error_Handler();
    }
}

/**
 * @brief 硬件CRC计算
 *
 * @param Data
 * @param Size
 * @return uint32_t
 */
uint32_t CRC_Calculate(uint32_t *Data, uint32_t Size)
{
    return 0;
}